import { ModuleWithProviders, NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { ClipboardModule } from '@angular/cdk/clipboard';
import { DragDropModule } from '@angular/cdk/drag-drop';

import {
  LayoutModule,
  AccordionModule,
  SearchModule,
  AvatarModule,
  BadgeModule,
  DropDownModule,
  FormModule,
  TabsModule,
  TextInputModule,
  ToggleModule,
  CheckBoxModule,
  ButtonModule,
  DrawerModule,
  DCommonModule,
  AlertModule,
  ToastModule,
  TooltipModule,
  RadioModule,
  CardModule,
  DataTableModule,
  BreadcrumbModule,
  TagsModule,
  SelectModule,
  LoadingModule,
  ModalModule,
  PaginationModule,
  TreeModule,
} from 'ng-devui';
import { I18nModule } from 'ng-devui/i18n';
import { TranslateModule } from '@ngx-translate/core';
import { HeaderComponent } from './components/header/header.component';
import { FooterComponent } from './components/footer/footer.component';
import { LoginComponent } from './components/login/login.component';
import { SideSettingsComponent } from './components/side-settings/side-settings.component';
import { PersonalizeComponent } from './components/personalize/personalize.component';
import { HeaderOperationComponent } from './components/header/header-operation/header-operation.component';
import { NavbarComponent } from './components/header/navbar/navbar.component';
import { HeaderLogoComponent } from './components/header/header-logo/header-logo.component';
import { DaGridModule } from './layouts/da-grid';
import { SideMenuComponent } from './components/side-menu/side-menu.component';
import { RegisterComponent } from './components/register/register.component';
import { HeaderNoticeComponent } from './components/header/header-operation/header-notice/header-notice.component';
import { StatusPipe } from './pipes/status.pipe';
import { EncodeSectionComponent } from './components/encode-section/encode-section.component';
import { InputNumberModule } from 'ng-devui';
import { RuleToTextPipe } from './pipes/rule-to-text.pipe';
import { HeaderFastNavComponent } from './components/header/header-operation/header-fast-nav/header-fast-nav.component';
import { isEmpowerment } from './pipes/isEmpowerment.pipe';
import { GenderPipe } from './pipes/gender.pipe';
import { UserTypePipe } from './pipes/user-type.pipe';
import { OtherLoginComponent } from './components/other-login/other-login.component';
import { FlowNodeComponent } from './components/flow-node/flow-node.component';
import { SidemenuComponent } from './components/sidemenu/sidemenu.component';
import { SelectUserComponent } from './components/select-user/select-user.component';
import { DateFormatPipe } from './pipes/date-format.pipe';
import { SeleceDeviceComponent } from './components/selece-device/selece-device.component';
import { IsInsuredPipe } from './pipes/is-insured.pipe';
import { ProcessNodeComponent } from './components/process-node/process-node.component';
import { IsFirstInspectionPipe } from './pipes/isFirstInspection/is-first-inspection.pipe';
import { SelectMaterialComponent } from './components/select-material/select-material.component';
import { SelectTechnologyRouteComponent } from './components/select-technology-route/select-technology-route.component';
import { DateFormPipe } from './pipes/dateform/date-form.pipe';
import { IsApprovalPipe } from './pipes/isApproval/is-approval.pipe';
import { SelectPositionComponent } from './components/select-position/select-position.component';
import { SelectWorkShopComponent } from './components/select-work-shop/select-work-shop.component';
import { LogComponent } from './components/log/log.component';
import { YerOrNoPipe } from './pipes/YesorNo/yer-or-no.pipe';
import { SelectMOMComponent } from './components/select-mom/select-mom.component';
import { SelectProcessComponent } from './components/select-process/select-process.component';
import { IsAssignPipe } from './pipes/isAssign/is-assign.pipe';
import { IsFinishedPipe } from './pipes/isFinished/is-finished.pipe';
import { IsLockedPipe } from './pipes/isLocked/is-locked.pipe';
import { AssignUserComponent } from './components/assign-user/assign-user.component';
import { AttachmentComponent } from './components/attachment/attachment.component';
import { SelectStorehouseComponent } from './components/select-storehouse/select-storehouse.component';
import { BooleanToTextPipe } from './pipes/booleanTotext/boolean-to-text.pipe';
import { SelectInventoryComponent } from './components/select-inventory/select-inventory.component';
import { ReportHistoriesComponent } from './components/report-histories/report-histories.component';
import { TreeComponent } from './components/shared/tree/tree.component';
import { PadNumberPipe } from './pipes/padNumber/pad-number.pipe';
import { ReviewFormDataComponent } from './components/review-form-data/review-form-data.component';
import { PadZeroPipe } from './pipes/addZero/pad-zero.pipe';
import { NumberInputComponent } from './components/number-input/number-input.component';
import { SelectCustomerComponent } from './components/select-customer/select-customer.component';
import { SelectSupplierComponent } from './components/select-supplier/select-supplier.component';
import { SelectLogisticsComponent } from './components/select-logistics/select-logistics.component';

const DEVUI_MODULES = [
  LayoutModule,
  AccordionModule,
  SearchModule,
  AvatarModule,
  BadgeModule,
  DropDownModule,
  FormModule,
  TabsModule,
  TextInputModule,
  ToggleModule,
  CheckBoxModule,
  ButtonModule,
  DrawerModule,
  CardModule,
  DataTableModule,
  BreadcrumbModule,
  TagsModule,
  SelectModule,
  RadioModule,
  LoadingModule,
  ModalModule,
  InputNumberModule,
  TreeModule
];
const COMPONENTS = [HeaderComponent, FooterComponent, NavbarComponent, PersonalizeComponent,HeaderFastNavComponent];
@NgModule({
  declarations: [
    LoginComponent,
    SideSettingsComponent,
    HeaderOperationComponent,
    HeaderLogoComponent,
    SideMenuComponent,
    HeaderNoticeComponent,
    RegisterComponent,
    ...COMPONENTS,
    StatusPipe,
    EncodeSectionComponent,
    RuleToTextPipe,
    isEmpowerment,
    GenderPipe,
    UserTypePipe,
    OtherLoginComponent,
    FlowNodeComponent,
    SidemenuComponent,
    SelectUserComponent,
    DateFormatPipe,
    SeleceDeviceComponent,
    IsInsuredPipe,
    ProcessNodeComponent,
    IsFirstInspectionPipe,
    SelectMaterialComponent,
    SelectTechnologyRouteComponent,
    DateFormPipe,
    IsApprovalPipe,
    SelectPositionComponent,
    SelectWorkShopComponent,
    LogComponent,
    YerOrNoPipe,
    SelectMOMComponent,
    SelectProcessComponent,
    IsAssignPipe,
    IsFinishedPipe,
    IsLockedPipe,
    AssignUserComponent,
    AttachmentComponent,
    SelectStorehouseComponent,
    BooleanToTextPipe,
    SelectInventoryComponent,
    ReportHistoriesComponent,
    TreeComponent,
    PadNumberPipe,
    ReviewFormDataComponent,
    PadZeroPipe,
    NumberInputComponent,
    SelectCustomerComponent,
    SelectSupplierComponent,
    SelectLogisticsComponent
  ],
  imports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    RouterModule,
    TranslateModule,
    DCommonModule,
    AlertModule,
    ClipboardModule,
    ToastModule,
    TooltipModule,
    PaginationModule,
    I18nModule,
    DaGridModule,
    DragDropModule,
    ...DEVUI_MODULES,
  ],
  exports: [
    CommonModule,
    FormsModule,
    TranslateModule,
    HeaderLogoComponent,
    HeaderOperationComponent,
    I18nModule,
    DaGridModule,
    SideMenuComponent,
    ...DEVUI_MODULES,
    ...COMPONENTS,
    StatusPipe,
    EncodeSectionComponent,
    RuleToTextPipe,
    isEmpowerment,
    GenderPipe,
    UserTypePipe,
    FlowNodeComponent,
    SidemenuComponent,
    SelectUserComponent,
    DateFormatPipe,
    IsInsuredPipe,
    ProcessNodeComponent,
    IsApprovalPipe,
    YerOrNoPipe,
    IsLockedPipe,
    IsFinishedPipe,
    IsAssignPipe,
    BooleanToTextPipe,
    TreeComponent,
    PadNumberPipe,
    PadZeroPipe,
    NumberInputComponent
    ],
})
export class SharedModule {
  static forRoot(): ModuleWithProviders<SharedModule> {
    return {
      ngModule: SharedModule,
      providers: [],
    };
  }
}
